<template>
    <p class="pcolor" @click="fontColor='red'">点击后颜色变化</p>
</template>

<script setup lang='ts'>
    import {ref} from 'vue';

    let fontColor = ref('green');

</script>

<style scoped>
    .pcolor{
        color: v-bind(fontColor)
    }
</style>